package pam.sample;

import pam.web.AbstractPamlet;
import pam.web.IPamletFactory;
import pam.web.WebException;

class BookPamletFactory implements IPamletFactory {

	String applet_get_books = "1";
	String applet_get_book = "2";

	public AbstractPamlet getPamlet(String pamletName)
			throws WebException {

		if (pamletName.equals(applet_get_book)) {
			return new QueryBookPamlet();
		} else if (pamletName.equals(applet_get_books)) {
			return new QueryBooksPamlet();
		}

		throw new WebException("未知请求");
	}

}
